CFLAGS=-Wall -pedantic -Wextra #-Werror
CXX=g++
LINK=-lglut -lGL
HEADERS=common.h

# $@ is the name of the file to be made

app: main.o vertex.o triangle.o objobject.o vertexnormal.o vtexcoord.o texture.o texturemanager.o objectmanager.o objanim.o
	$(CXX) $(CFLAGS) -o $@ $^ $(LINK)
#	./app

vertex.o: vertex.cpp vertex.h $(HEADERS)
	$(CXX) $(CFLAGS) -c vertex.cpp -o $@

vertexnormal.o: vertexnormal.cpp vertexnormal.h $(HEADERS)
	$(CXX) $(CFLAGS) -c vertexnormal.cpp -o $@

vtexcoord.o: vtexcoord.cpp vtexcoord.h $(HEADERS)
	$(CXX) $(CFLAGS) -c vtexcoord.cpp -o $@

triangle.o: triangle.cpp triangle.h $(HEADERS)
	$(CXX) $(CFLAGS) -c triangle.cpp -o $@

texture.o: texture.cpp texture.h $(HEADERS)
	$(CXX) $(CFLAGS) -c texture.cpp -o $@

texturemanager.o: texturemanager.cpp texturemanager.h $(HEADERS)
	$(CXX) $(CFLAGS) -c texturemanager.cpp -o $@

objectmanager.o: objectmanager.cpp objectmanager.h $(HEADERS)
	$(CXX) $(CFLAGS) -c objectmanager.cpp -o $@

objobject.o: objobject.cpp objobject.h $(HEADERS)
	$(CXX) $(CFLAGS) -c objobject.cpp -o $@

objanim.o: objanim.cpp objanim.h $(HEADERS)
	$(CXX) $(CFLAGS) -c objanim.cpp -o $@

main.o: main.cpp $(HEADERS)
	$(CXX) $(CFLAGS) -c main.cpp -o $@

clean:
	rm main.o vertex.o objobject.o triangle.o vertexnormal.o vtexcoord.o texture.o texturemanager.o objectmanager.o objanim.o app 
